#ifndef AUTO_AIM_H
#define AUTO_AIM_H

#include "robot_def.h"


#define real_shoot_speed         	27
#define GRAVITY_G 					9.7833f

#ifndef M_PI
#define M_PI						3.1415926f
#endif

#define Clockwise 1              //顺时针旋转
#define AntiClockwise -1				 //逆时针旋转

#define Armor_Wait			1
#define Armor_Track			2

#define Fire_OK					1
#define Fire_Err				2

#define Vision_OK				1
#define Vision_Error		2

#define identify_armor	0

#define armor_slant_angle 		M_PI/12

#define large_armor_width 		230.0f
#define small_armor_width 		135.0f
#define large_armor_height		127.0f
#define small_armor_height		125.0f

/*结构体变量定义---------------------------------------------------------------------*/
 typedef struct{
	unsigned int solution_num;
	float ang_solution1;
	float ang_solution2;
}ballistic_sol_t;

//X_positon,Y_positon,yaw_angle均为预测后的位置和角度
typedef struct{
	float xy0,z0,X_positon,Y_positon,yaw_angle;
}target_spac_t;

/* 本模块向外部提供的变量声明 -----------------------------------------------*/

/* 本模块向外部提供的自定义数据类型变量声明 ---------------------------------*/
extern target_spac_t target_space_aim;
extern ballistic_sol_t ballistic_solusion,buff_ballistic_solusion;
extern target_spac_t* determine_target;

extern uint8_t rotate_flag;
extern uint8_t fire_status;
extern uint8_t armor_status;
extern uint8_t wait_armor, track_armor;


uint8_t aimcenter_judge(float rotate_speed,float aim_speed);
uint8_t top_status_judge(float rotate_speed);
int8_t 	top_direction_judge(float rotate_speed);

uint8_t Woody_Autoaim(uint8_t shoot_speed);
uint8_t Woody_Antitop(uint8_t shoot_speed);
uint8_t Woody_Aimcentre(uint8_t shoot_speed);
uint8_t Woody_Antioutpost(uint8_t shoot_speed);

#endif // !AUTO_AIM_H